{% extends "../main.html" %}
{% block head_js %}
<link href="{{static_url('datatable/jquery.dataTables.css')}}" rel="stylesheet">
<!--link href="http://cdn.datatables.net/1.10.0/css/jquery.dataTables.css" rel="stylesheet"-->
<!--<style type="text/css">-->
<!--document.getElementById("uploadBtn").onchange = function () {-->
    <!--document.getElementById("uploadFile").value = this.value;-->
<!--};-->
<!--#red {color: red;}-->
<!--#blue {color: blue;}-->
<!--#orange {color: orange;}-->
<!--#green {color: green;}-->
<!--a {color: inherit;}-->


<!--</style>-->
{% end %}
{% block nem %}
<!--<ul class="nav nav-sidebar">-->
    <!--<li class="active"><a href="/file">文件管理s</a></li>-->
    <!--<li><a href="/file">文件上传</a></li>-->
<!--</ul>-->
{% end %}
{% block bodyy %}
<!--<h3 >文件列表</h3>-->
<!--<div class="panel panel-primary">-->
    <!--<div class="panel-heading">-->
      <!--<h3 class="panel-title">文件上传</h3>-->
    <!--</div>-->
    <!--<div class="panel-body">-->
        <form action="" method="post" enctype="multipart/form-data">
            <table>
                <tr>
                    <td><input type="file" name="file" class="upload"/></td>
                    <td>
                        <button class="btn btn-primary" type="submit" name="cmd" value="upload">上传</button>
                    </td>
                </tr>
            </table>
        </form>
    <!--</div>-->
<!--</div>-->
<h3 class="sub-header"></h3>
<form method="post">
    <table id="hosts" class="table table-striped">
        <thead>
        <tr>
            <th>选择</th>
            <th>文件名称</th>
            <th>大小(bite)</th>
            <th>上传者</th>
            <th>上传时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for i in res %}
        <tr>
            <td><input name="filename" type="checkbox" value="{{i[0]}}"/></td>
            <td><a href="/static/upload/{{i[0]}}" target="_blank">{{i[0]}}</a></td>
            <td>{{i[1]}}</td>
            <td>暂无</td>
            <td>{{i[2]}}</td>
            <td>
                <a href="/static/upload/{{i[0]}}"  class="btn btn-primary btn-xs" target="_blank">下载</a>
                <button type="submit" name="cmd" value="remove" class="btn btn-danger btn-xs">删除</button>
            </td>
        </tr>
        {% end %}
        </tbody>
    </table>
</form>


{% end %}
{% block body_js %}
<script src="{{ static_url('datatable/jquery.dataTables.min.js') }}"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#hosts').dataTable({
            "language": {
                "url": "{{ static_url('datatable/Chinese.json') }}"
            }
        });
    });


</script>
{% end %}
